package com.iseastar.guojiang.wallet;

import android.view.View;

import com.iseastar.BaseActivity2;
import com.shouhuobao.station.R;
import com.shouhuobao.take.weight.popupwindow.BasePopupWindow;

/**
 * 资金记录筛选
 * Created by lidandan on 2018/1/18.
 */
public class WalletMoneyFilterPopwin extends BasePopupWindow implements View.OnClickListener {

    private BaseActivity2 activity = null;
    private int type;

    /**
     * @param context
     */
    public WalletMoneyFilterPopwin(BaseActivity2 context, int type) {
        super(context, R.style.popup_window_small2big);
        activity = context;
        this.type = type;
    }

    @Override
    protected void findViewById() {
        setContentView(R.layout.layout_wallet_money_record_pop);
        //全部
        findViewById(R.id.all_tv).setOnClickListener(this);
        //只看佣金收入
        findViewById(R.id.brokerage_tv).setOnClickListener(this);
        //只看提现记录
        findViewById(R.id.with_draw_tv).setOnClickListener(this);
        //只看信息记录
        findViewById(R.id.message_tv).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.all_tv:
                if (type != 0) {
                    ((WalletMoneyRecordActivity) activity).loadData(1, 0);
                }
                dismiss();
                break;
            case R.id.brokerage_tv:
                if (type != 1) {
                    ((WalletMoneyRecordActivity) activity).loadData(1, 1);
                }
                dismiss();
                break;
            case R.id.with_draw_tv:
                if (type != 2) {
                    ((WalletMoneyRecordActivity) activity).loadData(1, 2);
                }
                dismiss();
                break;
            case R.id.message_tv:
                if (type != 3) {
                    ((WalletMoneyRecordActivity) activity).loadData(1, 3);
                }
                dismiss();
                break;

        }
    }
}
